// app.js
App({
  onLaunch() {

  },
  globalData: {
      index: -1,
      isLoggedIn: false,
      openid: null
  },
  checkLoginStatus() {
      const token = wx.getStorageSync('token');
      const openid = wx.getStorageSync('openid');
      console.log('读取的 token:', token);
      console.log('读取的 openid:', openid);
      if (token && openid) {
          this.globalData.isLoggedIn = true;
          this.globalData.openid = openid;
          return true;
      }
      this.globalData.isLoggedIn = false;
      this.globalData.openid = null;
      return false;
  }
})
